package emby.stmt;

import emby.EmbyRuntime;
import emby.expr.Variable;
import emby.lang.Block;
import emby.lang.EmbyFunction;
import emby.lang.Scope;

/**
 * Properties are parameter-less functions
 * THIS IS NOT IMPLEMENTED IN THE PARSER YET
 * @author Justin
 *
 */
public class DefineProperty extends DefineFunction {
	private static final long serialVersionUID = 2588789439464563762L;

	public DefineProperty(String fname, Block _body){
		super(fname, _body, (Variable[])null);
	}

	@Override
	public Object eval(Scope s) {
		EmbyFunction func =  new EmbyFunction(name, s, body, params );
		if(EmbyRuntime.echo){
			emby.util.Print.println("Defining property"+func);
		}
		s.setVar(name, func);
		return null;
	}
}
